import {Input, InputNumber} from 'antd';
import React from 'react';
import {ParamType} from '@/component/param-setting/enum';

export default function WInput(props: any) {
  const {onSave, record, ...res} = props;
  if (record?.paramType === ParamType.字符串) {
    return <Input {...res} onBlur={onSave}/>;
  } else if ([ParamType.浮点, ParamType.整数, ParamType.长整数].includes(record?.paramType)) {
    return <InputNumber {...res} onBlur={onSave}/>;
  }
  return <Input {...res} onBlur={onSave}/>;
}
